﻿using CNKI.TPI.Web.Base;
using CNKI.TPI.Web.Interface.Models;
using CNKI.TPI.Web.Report.IBLL;
using CNKI.TPI.Web.Search.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace CNKI.TPI.Web.Interface.Areas.Log.Controllers
{
    public class GetDBCLSInfoController : ApiController
    {
        private IDBStatisticsService dbStatisticsService = null;

        public GetDBCLSInfoController(IDBStatisticsService dbStatisticsService)
        {
            this.dbStatisticsService = dbStatisticsService;
        }

        // GET api/userrecommend/5
        public object Get()
        {
            OutputEntity result = new OutputEntity();
            try
            {
                IList<SYS_CMS_DATABASE_CLS_NODE> content = dbStatisticsService.GetTemplateClS();
                if (content == null)
                {
                    result.Status = Status.Error;
                }
                else
                {
                    result.Status = Status.Success;
                    result.data = content;
                }
            }
            catch (Exception ex)
            {
                LogOpr.Error(ex.ToString());
                result.Status = Status.Error;
                result.message = ex.Message;
            }
            return result;
        }
    }
}
